package com.villaday.idf.adapter;

import android.content.Context;
import android.graphics.Paint;
import android.view.View;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.model.Presell_recommend_listEntity;
import com.villaday.idf.model.TopicEntity;
import com.villaday.idf.util.PhoneUtil;

/**
 * 首页动态列表
 */

public class CaiLikeAdapter extends AbsRecyclerViewAdapter<Presell_recommend_listEntity.BodyBean> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;
/*
    private final String roleType;
*/

    public CaiLikeAdapter(Context context) {
        super(context, R.layout.item_cai_like, R.layout.item_page_loading,
                R.layout.item_page_bottom);

       /* RefreshtokenEntity.BodyBean roleInfo =
                SharedPreferencesUtil.getRoleInfo(context);
        roleType = roleInfo.getMember().getType();*/

    }


    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, Presell_recommend_listEntity.BodyBean d, int position) {
        holder.bindSimpleDraweeView(R.id.sdv,d.getImageUrl())
                .bindTextView(R.id.tv_title,d.getName())
                .bindTextView(R.id.tv_zhe,d.getDiscount()+"折")
                .bindTextViewWithHtml(R.id.tv_delete,"&yen;" + d.getOriginalPrice())
                .bindTextViewWithHtml(R.id.tv_price,"&yen;" + d.getCurrentPrice() );

        TextView view = (TextView) holder.getView(R.id.tv_delete);
//添加删除线
        view.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);




    }
}
